//
//  FoodDetailModel.m
//  LoveBeeProject
//
//  Created by dix on 2017/1/5.
//  Copyright © 2017年 斯芬克斯. All rights reserved.
//

#import "FoodDetailModel.h"
#import <YYModel.h>
#import "FoodModel.h"
@implementation FoodDetailModel
+ (void)loadNewsDataWithDataDict:(NSDictionary *)dataDict dataArr:(NSArray *)dataArr success:(void(^)(NSDictionary *newsDict))successBlock{
    NSMutableDictionary *TmpDict = [NSMutableDictionary dictionary];
    for (int i = 0; i < dataArr.count; i++) {
        
        FoodModel *model = dataArr[i];
        
        NSString *idStr = model.id;
        NSDictionary *result = dataDict[@"products"];
        
        NSArray *idArr = result[idStr];
        NSArray *newsData = [NSArray yy_modelArrayWithClass:[FoodDetailModel class] json:idArr];
        
        [TmpDict setValue:newsData forKey:idStr];
        
    }
    NSDictionary *newsDict = TmpDict.copy;
    if (successBlock) {
        successBlock(newsDict);
    }
}

@end
